import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class LengthCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'length'
        command.component = 'NormalCommandComponent'

        return new LengthCommand(command, false)
    }

    usage(): string {
        return 'length [-b] 字符串'
    }

    description(): string {
        return `<div>统计给定字符串的长度，默认为字符数</div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">-b --bytes</span><span>统计字符串的字节数</span></div>`
    }
}
